import Vue from "vue";
import VueRouter from "vue-router";
import Home from "./views/Home.vue";

Vue.use(VueRouter);

const routes = [{
  path: "/",
  name: "index",
  redirect: "/home",
}, {
  path: "/home",
  name: "home",
  component: Home,
  children: [{
    path: "",
    name: "mainPage",
    component: () => import("./components/section/MainPage.vue")
  }, {
    path: "dataCenter",
    name: "dataCenter",
    component: () => import("./components/section/DataCenter.vue")
  }, {
    path: "messageCenter",
    name: "messageCenter",
    component: () => import("./components/section/MessageCenter.vue")
  }, {
    path: "manageCenter",
    name: "manageCenter",
    component: () => import("./components/section/ManageCenter.vue")
  }, {
    path: "logRecord",
    name: "logRecord",
    component: () => import("./components/section/LogRecord.vue")
  }]
}, {
  path: "/login",
  name: "login",
  component: () => import("./views/Login.vue")
}];

const router = new VueRouter({
  routes
});

export default router;
